package com.smart.manager.pop.entities.body;


import com.smart.common.entities.core.BaseSearch;
import com.smart.manager.pop.entities.assembler.DsRule;
import com.smart.manager.pop.entities.enums.LevelGetWay;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 等级规则
 *
 * @author Administrator
 * @date 2022/10/31
 */

public class RDisLevel {


    /**
     * 支付订单搜索条件
     *
     * @author xiaxuqiu
     * @date 2022/10/17
     */
    @Data
    @EqualsAndHashCode(callSuper = true)
    @ApiModel("RDisManager1")
    public static class SearchBody extends BaseSearch {

        @ApiModelProperty("等级名称")
        private String name;

        @ApiModelProperty("前端别名")
        private String nickName;

        @ApiModelProperty(value = "等级获得方式")
        private LevelGetWay getWay ;

    }


    @Data

    @ApiModel("RDisManager2")
    public static class EditBody implements Serializable {

        @ApiModelProperty(value = "级别序号")
        @NotNull(message = "级别序号 不能为空")
        @Min(value = 0, message = "级别序号 不能小于0")
        @Max(value = 100, message = "级别序号 不能大于100")
        private Integer code;

        @ApiModelProperty(value = "级别名称")
        @NotBlank(message = "级别名称 不能为空")
        @Length(max = 20, message = "级别名称 长度不能超过20")
        private String name;


        @ApiModelProperty(value = "前端别名")
        @NotBlank(message = "前端别名 不能为空")
        @Length(max = 20, message = "级别名称 长度不能超过20")
        private String nickName;



        @ApiModelProperty(value = "图标")
        @NotBlank(message = "显示图标 不能为空")
        private String icon;

        @ApiModelProperty(value = "介绍图片")
        @NotBlank(message = "显示介绍图片 不能为空")
        private String introduceImg;


        @ApiModelProperty(value = "等级描述")
        @NotBlank(message = "等级描述 不能为空")
        @Length(max = 500, message = "级别名称 长度不能超过255")
        private String description;




        @ApiModelProperty(value = "等级规则")
        @NotNull(message = "等级规则 不能为空")
        private DsRule rule ;
    }


}
